package org.jimmy.tang.lang;

/**
 * @author jimmy
 * 
 */
public class InterfaceDemo {
    public static void main(String... args) {
        Employee6 e = new Employee6("Lily", 1000);
        System.out.print(e.compareTo(new Employee6("Bob", 2000)));// 1
    }
}

class Employee6 implements Comparable<Employee6> {
    public Employee6(String name, double salary) {
        this.name = name;
        this.salary = salary;
    }

    @Override
    public int compareTo(Employee6 other) {
        if (salary > other.salary) {
            return -1;
        }
        if (salary < other.salary) {
            return 1;
        }
        return 0;
    }

    // 定义变量
    private double salary;
    private String name;
}

interface Test {
    int sx = 1;
    static int s = 2;
}
